from shop.models import Cart

class CartMiddleware(object):
    """Adds Cart object to all request objects."""

    def process_request(self, request):
        request.cart = Cart(request)

